home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sun Solutions 2000 #2
/
Sun Solutions CD (Volume 2 2000)(Special Focus - Java Technologies)(Disc 1).ISO
/
products
/
Software
/
BostonBusinessComputing
/
bbc
/
vmail.setup
< prev
next >
Wrap
Text File
|
2000-02-11
|
1KB
|
57 lines
:
# Determine how to get group id
lscmd=`(ls -ldg . ; ls -ld .) | awk 'NR==1{fields=NF} NR==2{if (fields > NF) { print "ls -ldg" } else { print "ls -ld" }}'`
tbput display "Checking for the location of the native mail spool directory..."
mail_path=''
for d in /usr/mail /usr/spool/mail /var/mail /var/spool/mail; do
[ -d $d/. ] || continue
mail_path=$d
break
done
tbput display 'done
'
if [ -z "$mail_path" ]; then
#
# Incorrect mail path or no mail path detected.
# Ask for mail spool directory.
#
while :; do #1 Keep asking for dir until got a good one
tbput display "
Please enter the full path of the mail spool directory: "
read mail_path || exit 1
#
# Keep looping if blank
#
[ -z "$mail_path" ] && continue
#
# Check that this directory exists
#
[ -d "$mail_path/." ] && break
#
# It doesn't exist. Ask if this is ok.
#
tbput display "The \b$mail_path\B directory cannot be detected."
done
fi
#
# Get Group ID
#
set -$- `eval $lscmd $mail_path/.`
group_priv=$4
#
# Set Protections for Vmail
#
chgrp $group_priv $BBC/vmail.x
chmod 755 $BBC/vmail.x
chmod g+s $BBC/vmail.x
chmod g+w $mail_path
tbput display "Your mail spool directory is \b$mail_path\B.
The protections and group ownership for Vmail have been changed
to correspond with those of that directory.
"